<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
    <link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
    <link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/apply.css" source="widget" />   
    <script src="${ctx}/js/controllers/store/storebanner/StoreBannerAddController.js" type="text/javascript"></script>
    <div style="top:130px;position:fixed;height:30px;font-size: 14px;font-family: '微软雅黑';margin-left:-236px;">
                当前位置：${sessionScope.currcent_position}
          </div>
          <section>
                 <div class="panel panel-default" style="margin-top:16px;">
                  <div class="forword_area"></div>
                    <div class="location">添加装修</div>
                    </div>

                        <div id="form" class="form" style="min-height:450px;border: 1px solid #e6e6e6;">
                                    <div class="itemEdit"">
                                     <span class="col-sm-1 editlableDetail" style="font-size:14px;"><em class="emStyle">*</em>标题：</span>
                                       <div class="fldetail-4l">
                                       <input id="storeBannerId" type="hidden" value="${storeBanner.id}">
                                       <input class="controlEdit" id="title" onblur="checkTitle()" style="width:100%;margin-left: -81px;"  type="text" value="${storeBanner.title}" maxlength="50">
                                      </div>
                                      <span class="col-sm-1 editlableDetail" style="font-size:14px;margin-left:70px">备注：</span>
                                       <div class="fldetail-4r">
                                       <input class="controlEdit" id="memo" style="width:100%;margin-left: -81px;"  type="text" value="${storeBanner.memo}" maxlength="100">
                                      </div>
                                    </div> 
                                     <div  class="itemEdit" style="height:220px;">
                                        <input id="imageLogo" type="hidden" value="${storeBanner.img }">
                                        <span class="col-sm-1 editlableDetail" style="font-size:14px;">装修图片：</span>
                                        <div class="flEditMap">
                                        
                                            <c:if test="${storeBanner.img == null || storeBanner.img == ''}">
                                                    <img id="preview3" style="width:150px;height:150px;float:left;margin-left:-20px" title="快上传图片吧" src="${ctx}/images/store/shop_logo.jpg" />
                                            </c:if>
                                            <c:if test="${storeBanner.img != null && storeBanner.img != ''}">
                                                <img id="preview3" style="width:150px;height:150px;float:left;margin-left:-15px" src="${sessionScope.image_logo}${storeBanner.img}" />
                                            </c:if>
                                            <div class="mtjxsa" style="float:left;margin-top: 40px;">
                                  <p style="text-align: left;margin-left:-20px" id="imageBtn">
                                      <input type="hidden" name="imageLogoUrl" id="imageLogoUrl" />
                                      <img style="margin-left:23px;margin-top: -5px;" src="${ctx}/images/seller/goods/tip.png"/>
                                      <span style="color:#262535;font-size:14px;">提示：只能上传.jpg, .png的图片格式,照片文件大小最大为10MB</span>
                                  </p>
                                  <div>
                                      <div class="fl">
                                          <button style="width:100px;height:30px;background-color: #F9C771;border-radius: 4px;color: #fff;margin-top: 10px;border: 0px;" class="acblu tctpsc">上传图片</button>
                                      </div>
                                  </div>
                              </div>
                                            <%@include file="/views/common/uploader/picture.jsp" %>
                                        </div>
                                    </div>
                                    <div class="itemEdit">
                                       <span class="col-sm-1 editlableDetail" style="font-size:14px;"><em class="emStyle">*</em>对象类型：</span>
                                        <div class="fldetail-4l" >
                                        <select id="objType" onblur="checkObjType()" onchange="selectChange()" style="height: 29px;width: 70%; margin-left: -43px;margin-top: -4px" required>
                                        <option  value="" selected="selected">请选择对象类型</option>
                                         <option value="1">商品</option>
                                         <option value="2">特殊网页</option>
                                        </select>
                                        </div>
                                        <input type="hidden" id="shopId" value="${sessionScope.shop_id.id}"/>
                                        <span class="col-sm-1 editlableDetail" id="objContent1" style="font-size:14px;display:none;margin-left: 70px;"><em class="emStyle">*</em>请选择商品：</span>
                                        <div class="fldetail-4r" id="objC1" style="display:none">
                                        <select id="goodsId"  onblur="checkGoods()"  style="height: 29px;width: 70%; margin-left: -28px;margin-top: -4px" required>
                                        <option value=''>请选择商品</option>
                                         <c:forEach items="${goodsInfos}"
                                          var="item" varStatus="cStatus">
                                         <option value="${item.id}">${item.name}</option>
                                        </c:forEach>
                                        </select>
                                        </div>
                                        <span class="col-sm-1 editlableDetail" id="objContent2" style="font-size:14px;display:none;margin-left: 70px;"><em class="emStyle">*</em>网页地址：</span>
                                        <div class="fldetail-4r" id="objC2" style="display:none">
                                            <input class="controlEdit" id="webUrl"  onblur="checkURL()" style="width:85%;margin-left:-52px;"  type="text" maxlength="50" value="${storeBanner.url}"> 
                                        </div>
                                    </div>
                                    
                    </div>
                            <div class="foot">
                            <div >
                                <div style="float:left;padding-left:45%;padding-top:19px">
                                    <button class="buttonEdit" onclick="saveStoreBanner();">添&nbsp;&nbsp;加</button>
                                </div>
                                <!-- <div style="float:left;margin-left:2%;padding-top:19px">
                                    <button class="buttonCancle" onclick="cancel();">取&nbsp;&nbsp;消</button>
                                </div> -->
                                </div>
                            </div>
                
              </section>
        <script type="text/javascript">
        var ctx = '${ctx}';
        setCtx(ctx);
        function selectChange(){
            if($("#objType option:selected").val()==""){
                $("#objContent1").hide();
                $("#objC1").hide();
                $("#objContent2").hide();
                $("#objC2").hide();
            }
            if($("#objType option:selected").val()==1){
                $("#objContent1").show();
                $("#objC1").show();
                $("#objContent2").hide();
                $("#objC2").hide();
                //alert($("#goodsId option:selected").text());
            }
            if($("#objType option:selected").val()==2){
                $("#objContent2").show();
                $("#objC2").show();
                $("#objContent1").hide();
                $("#objC1").hide();
            }
        }
        
    </script>
    
    <!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
    <script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
